<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class GameValidate extends Validate
{
    protected $rule = [
        'game_name' => 'require',
        'brief'  => 'require',
        'play_url' => 'require',
        'win_probability' => 'require',
    ];
    protected $message = [
        'game_name.require' => '游戏名不能为空',
        'game_name.unique' => '游戏名已存在',
        'brief.require'  => '用户名已存在',
        'play_url.require'  => '游戏链接不能为空',
        'play_url.activeUrl'  => '游戏链接不正确',
        'win_probability.require' => '中奖概率不能为空',
    ];

    protected $scene = [
        'add'  => ['game_name', 'brief', 'play_url', 'win_probability'],
        'edit' => ['game_name', 'brief', 'play_url', 'win_probability'],
    ];
}